import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import i18n from "./i18n";
import "@/assets/style/app.scss";
import "@/assets/style/app.less";

Vue.prototype.bus = new Vue();
// Vue.prototype.title = import.meta.env.VITE_SENTRY_URL;

// 引入ElementUI组件
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(ElementUI, {
    size: "medium",
    zIndex: 3000,
    i18n: (key, value) => i18n.t(key, value),
});

// 引入iView
import iView from "iview";
import "iview/dist/styles/iview.css";
Vue.use(iView, {
    size: "default",
    i18n: (key, value) => i18n.t(key, value),
});

// 引入vxe-table
import VxeUITable from "vxe-table";
import "vxe-table/lib/style.css";
import VxeUI from "vxe-pc-ui";
Vue.use(VxeUI, {
    size: "mini",
    i18n: (key, value) => i18n.t(key, value),
});
import "vxe-pc-ui/lib/style.css";
Vue.use(VxeUITable, {
    size: "mini",
    table: {
        round: true,
    },
    i18n: (key, value) => i18n.t(key, value),
});

// 引入Viewer图片预览组件
import Viewer from "v-viewer";
import "viewerjs/dist/viewer.css";
Vue.use(Viewer);
Viewer.setDefaults({
    navbar: false, //底部缩略图
    toolbar: false, //底部工具栏
    button: false, //右上角按钮
    title: false, //当前图片标题
    movable: true, //是否可以移动
    zoomable: true, //是否可以缩放
    transition: false, //使用 CSS3 过度
});

// 引入moment 格式化时间方法
import moment from "moment";
moment.locale("zh-cn"); //指定语言
Vue.prototype.$moment = moment;

// 引入字体图标库
import "@/assets/iconfont/iconfont.css";

// 定义全局方法
Vue.prototype.goHome = function () {
    this.$router.push({
        name: "home",
    });
};

// 开发调试方法
import * as debug from "preval-build-info";
window.debug = debug;

new Vue({
    router,
    store,
    i18n,
    render: (h) => h(App),
}).$mount("#app");
